package utils

import (
	"math/rand"
)

// 获取老虎机活动，机器人，单次时间，活动道具增量
func GetSlotActRobotAutoAddItemNum(actTurn int64, randomSeed int64) (addNum int64) {
	addNum = 0
	rand.Seed(TNow().UnixNano() + randomSeed)
	var RandomX int64 = RandomInt64(0, 300)
	//var TurnFixed int64 = (turn - 1) * RandomX
	addNum = int64(RandomInt64(0, 1) * (RandomX * RandomInt64(0, 2) / 10))
	return
}

// 获取老虎机活动，机器人初始活动道具，也是新开分组时候要调用的
func GetSlotActRobotOrgItemNum(actTurn int64, offsetTime int64, randomSeed int64) (orgNum int64) {
	orgNum = 0
	if actTurn > 1 {
		rand.Seed(TNow().UnixNano() + randomSeed)
		var RandomX int64 = RandomInt64(0, 300)
		orgNum = (actTurn - 1) * RandomX
	} else {
		// 第一轮，按照小时补正道具
		if offsetTime > 0 {
			var step int64 = int64(offsetTime / 3600)
			if step > 0 {
				var stepAddNum = GetSlotActRobotAutoAddItemNum(actTurn, randomSeed)
				orgNum = orgNum + (step * stepAddNum)
			}
		}
	}
	return
}
